/**
 * 
 */
package ec.com.avila.hiperion.web.backings;

import javax.ejb.EJB;
import javax.faces.bean.ManagedProperty;

import ec.com.avila.hiperion.entities.Ramo;
import ec.com.avila.hiperion.servicio.RamoService;
import ec.com.avila.hiperion.web.beans.RamoBean;

/**
 * <b> Incluir aqui la descripcion de la clase. </b>
 * 
 * @author kruger
 * @version 1.0,Dec 21, 2013
 * @since JDK1.6
 */
public class RamoBacking {

	@ManagedProperty(value = "#{ramoBean}")
	private RamoBean ramoBean;

	@EJB
	private RamoService ramoService;

	public Ramo setearRamo() {
		Ramo ramo = new Ramo();

		ramo.setCodigoRamo(ramoBean.getCodigoRamo());
		ramo.setAseguradora(ramoBean.getAseguradora());
		ramo.setRamo(ramoBean.getRamo());
		ramo.setComision(ramoBean.getComision());

		return ramo;
	}

	public void guardarRamo() {
		ramoService.guardarRamo(setearRamo());
	}
}
